{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [],
   "source": [
    "random.seed (10)\n",
    "a1 = np.random.randint(0,100,size =(50,3))\n",
    "a2 = np.random.randint(0,100,size =(50,3))\n",
    "a3 = np.random.randint(0,100,size =(50,3))\n",
    "a4 = np.random.randint(0,100,size =(50,3))\n",
    "a5 = np.random.randint(0,100,size =(50,3))\n",
    "a6 = np.random.randint(0,100,size =(50,3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[28, 96, 84],\n",
       "       [57, 11, 85],\n",
       "       [20, 28,  8],\n",
       "       [ 5,  5, 38],\n",
       "       [15, 68, 67],\n",
       "       [ 1, 16, 11],\n",
       "       [24, 24, 37],\n",
       "       [19, 78, 12],\n",
       "       [57, 95,  7],\n",
       "       [79,  0, 53],\n",
       "       [52, 63, 41],\n",
       "       [34, 95, 93],\n",
       "       [81, 25, 37],\n",
       "       [25, 95, 21],\n",
       "       [87, 24, 79],\n",
       "       [47, 29, 23],\n",
       "       [66, 33, 90],\n",
       "       [51, 14, 18],\n",
       "       [86, 81, 49],\n",
       "       [19, 80, 67],\n",
       "       [ 3, 34, 85],\n",
       "       [50, 63, 39],\n",
       "       [83, 29, 13],\n",
       "       [87, 42, 20],\n",
       "       [41, 20, 32],\n",
       "       [78, 62, 85],\n",
       "       [25,  0, 31],\n",
       "       [18, 32, 63],\n",
       "       [39, 91, 78],\n",
       "       [ 9, 95, 90],\n",
       "       [39, 85, 68],\n",
       "       [19, 39, 86],\n",
       "       [54, 88, 94],\n",
       "       [95, 49, 67],\n",
       "       [63, 27, 18],\n",
       "       [24, 99, 69],\n",
       "       [71, 36,  7],\n",
       "       [72, 30, 84],\n",
       "       [96, 64,  4],\n",
       "       [40, 76, 70],\n",
       "       [57, 19, 16],\n",
       "       [96, 99, 29],\n",
       "       [26, 94, 53],\n",
       "       [71, 53, 67],\n",
       "       [52, 52, 52],\n",
       "       [91, 84, 32],\n",
       "       [91, 58, 93],\n",
       "       [68,  5, 41],\n",
       "       [55, 89, 84],\n",
       "       [66, 16, 55],\n",
       "       [29, 72, 76],\n",
       "       [23, 60, 96],\n",
       "       [15, 16, 15],\n",
       "       [34, 98, 60],\n",
       "       [18, 56,  0],\n",
       "       [76,  0, 17],\n",
       "       [13, 29, 79],\n",
       "       [85, 78, 12],\n",
       "       [88, 96, 81],\n",
       "       [ 4, 77, 22],\n",
       "       [64, 43, 41],\n",
       "       [36, 70, 36],\n",
       "       [19, 21, 88],\n",
       "       [41, 91, 84],\n",
       "       [31, 93, 84],\n",
       "       [45, 45, 65],\n",
       "       [77, 78, 13],\n",
       "       [94, 74, 81],\n",
       "       [27, 88, 10],\n",
       "       [49, 60, 11],\n",
       "       [54, 71, 36],\n",
       "       [81, 71, 48],\n",
       "       [28, 62, 87],\n",
       "       [21, 84, 44],\n",
       "       [59, 65, 23],\n",
       "       [82, 63, 89],\n",
       "       [ 4,  4, 14],\n",
       "       [22, 14, 90],\n",
       "       [96, 38, 89],\n",
       "       [99, 38, 91],\n",
       "       [60, 55,  5],\n",
       "       [78, 77, 88],\n",
       "       [72, 62,  1],\n",
       "       [73,  9,  2],\n",
       "       [92, 95, 10],\n",
       "       [75, 52, 11],\n",
       "       [12, 31, 94],\n",
       "       [47, 20, 47],\n",
       "       [21, 50, 59],\n",
       "       [22, 47,  1],\n",
       "       [77, 75, 95],\n",
       "       [60, 94, 96],\n",
       "       [95, 11, 57],\n",
       "       [ 9, 54, 79],\n",
       "       [79, 27, 46],\n",
       "       [74,  3, 41],\n",
       "       [45,  7, 42],\n",
       "       [45,  3, 59],\n",
       "       [68, 77, 67],\n",
       "       [40, 57, 56],\n",
       "       [45, 86, 64],\n",
       "       [79, 56, 41],\n",
       "       [41, 25, 31],\n",
       "       [62, 88, 33],\n",
       "       [94, 70, 99],\n",
       "       [24, 13,  0],\n",
       "       [57, 90, 39],\n",
       "       [ 4, 92, 20],\n",
       "       [66, 12,  9],\n",
       "       [95, 25, 33],\n",
       "       [58, 93, 64],\n",
       "       [20, 16, 92],\n",
       "       [41, 85, 20],\n",
       "       [41, 12, 25],\n",
       "       [67, 80, 26],\n",
       "       [46, 28, 27],\n",
       "       [86, 70, 37],\n",
       "       [35, 25, 90],\n",
       "       [94, 60,  8],\n",
       "       [99, 76, 32],\n",
       "       [90, 60, 96],\n",
       "       [37, 26, 80],\n",
       "       [35, 22, 44],\n",
       "       [ 4, 46, 33],\n",
       "       [84, 63, 86],\n",
       "       [14, 24, 35],\n",
       "       [54, 64, 71],\n",
       "       [56, 71,  6],\n",
       "       [ 3, 91, 37],\n",
       "       [85, 20, 64],\n",
       "       [50, 81, 74],\n",
       "       [23, 83, 23],\n",
       "       [52, 47, 60],\n",
       "       [22, 54, 15],\n",
       "       [80, 50, 71],\n",
       "       [ 9, 83,  3],\n",
       "       [97, 65, 90],\n",
       "       [21, 39, 68],\n",
       "       [55,  2, 96],\n",
       "       [61, 90, 81],\n",
       "       [15, 24, 63],\n",
       "       [56, 25, 71],\n",
       "       [34, 48,  6],\n",
       "       [33, 51,  9],\n",
       "       [94, 86, 15],\n",
       "       [43,  9,  5],\n",
       "       [39, 25, 97],\n",
       "       [66, 62, 80],\n",
       "       [63, 35, 67],\n",
       "       [13, 85, 21],\n",
       "       [33, 60, 49],\n",
       "       [57, 42, 81],\n",
       "       [27, 19, 95],\n",
       "       [84, 49, 50],\n",
       "       [71, 39, 81],\n",
       "       [94, 45, 47],\n",
       "       [20, 68, 45],\n",
       "       [73, 94, 63],\n",
       "       [83, 70, 70],\n",
       "       [74, 60, 97],\n",
       "       [20, 93, 23],\n",
       "       [61, 56, 79],\n",
       "       [99, 44, 31],\n",
       "       [50, 61, 78],\n",
       "       [96, 23, 41],\n",
       "       [75, 98, 40],\n",
       "       [ 2, 61, 69],\n",
       "       [12, 74, 38],\n",
       "       [ 0, 26, 63],\n",
       "       [55, 40, 48],\n",
       "       [53, 44, 24],\n",
       "       [ 6, 37, 52],\n",
       "       [77, 51, 78],\n",
       "       [59, 22, 77],\n",
       "       [93, 39, 85],\n",
       "       [68, 77, 76],\n",
       "       [80, 97, 20],\n",
       "       [46, 22, 68],\n",
       "       [94, 54, 75],\n",
       "       [87, 98, 87],\n",
       "       [69, 21,  5],\n",
       "       [72, 85, 20],\n",
       "       [48, 56, 62],\n",
       "       [89,  2, 99],\n",
       "       [19,  7, 75],\n",
       "       [85,  5, 27],\n",
       "       [90, 98, 68],\n",
       "       [52, 63, 88],\n",
       "       [53, 80, 46],\n",
       "       [ 1,  0, 29],\n",
       "       [20, 84, 91],\n",
       "       [84,  9, 60],\n",
       "       [61, 93, 40],\n",
       "       [22, 69, 93],\n",
       "       [59, 41, 43],\n",
       "       [85, 86, 34],\n",
       "       [69, 61, 52],\n",
       "       [33, 51, 14],\n",
       "       [ 8, 34, 32],\n",
       "       [ 6, 74, 50],\n",
       "       [46, 65, 91],\n",
       "       [40, 89, 13],\n",
       "       [80, 51, 77],\n",
       "       [30, 21, 30],\n",
       "       [61,  7, 53],\n",
       "       [18, 61, 95],\n",
       "       [ 2, 88, 21],\n",
       "       [99, 30, 23],\n",
       "       [52, 83, 65],\n",
       "       [35, 72, 37],\n",
       "       [ 2, 67,  8],\n",
       "       [70,  6, 15],\n",
       "       [52,  0,  9],\n",
       "       [75, 66, 73],\n",
       "       [66,  0, 30],\n",
       "       [ 7, 16, 95],\n",
       "       [89, 95, 53],\n",
       "       [77, 61, 86],\n",
       "       [69,  5, 26],\n",
       "       [33,  1,  4],\n",
       "       [53, 95, 84],\n",
       "       [96, 44, 54],\n",
       "       [37, 16, 12],\n",
       "       [56, 59,  7],\n",
       "       [24, 14, 83],\n",
       "       [63,  3, 76],\n",
       "       [75,  9, 18],\n",
       "       [11, 88, 36],\n",
       "       [55, 36, 57],\n",
       "       [47, 71, 43],\n",
       "       [76,  0, 16],\n",
       "       [82, 23, 22],\n",
       "       [17, 66, 20],\n",
       "       [13, 49, 47],\n",
       "       [51,  6, 84],\n",
       "       [82, 54, 77],\n",
       "       [15, 92,  7],\n",
       "       [26, 49, 12],\n",
       "       [40, 62, 76],\n",
       "       [17, 93, 53],\n",
       "       [12, 54, 23],\n",
       "       [62, 47, 47],\n",
       "       [17, 87, 91],\n",
       "       [60, 95, 23],\n",
       "       [73, 23, 37],\n",
       "       [67, 74, 95],\n",
       "       [24,  2, 75],\n",
       "       [22, 83, 98],\n",
       "       [69, 62,  5],\n",
       "       [19, 91, 27],\n",
       "       [51, 46,  5],\n",
       "       [84, 23, 77],\n",
       "       [46, 45, 64],\n",
       "       [95, 15, 95],\n",
       "       [83, 90, 99],\n",
       "       [90, 12, 71],\n",
       "       [45, 35, 27],\n",
       "       [99, 51, 19],\n",
       "       [88, 66, 34],\n",
       "       [ 8, 10, 63],\n",
       "       [93, 16,  7],\n",
       "       [36, 87, 44],\n",
       "       [27, 77, 20],\n",
       "       [85, 91, 37],\n",
       "       [69, 20, 74],\n",
       "       [ 1, 11,  3],\n",
       "       [74, 26, 34],\n",
       "       [39, 37, 49],\n",
       "       [41, 59, 47],\n",
       "       [70,  0, 64],\n",
       "       [43, 10, 45],\n",
       "       [85, 58, 21],\n",
       "       [42, 41, 20],\n",
       "       [38, 50, 99],\n",
       "       [42, 95, 16],\n",
       "       [51, 48, 71],\n",
       "       [88, 52,  3],\n",
       "       [85,  1, 25],\n",
       "       [44, 14, 24],\n",
       "       [77, 11, 59],\n",
       "       [11,  8, 13],\n",
       "       [74, 70, 75],\n",
       "       [38, 60, 64],\n",
       "       [41, 12, 11],\n",
       "       [39,  7, 35],\n",
       "       [ 1, 18, 99],\n",
       "       [19, 38, 87],\n",
       "       [34, 39, 32],\n",
       "       [89, 69, 97],\n",
       "       [21, 41, 49],\n",
       "       [43, 47, 77],\n",
       "       [52, 57,  4],\n",
       "       [30, 55, 58],\n",
       "       [61, 29, 63],\n",
       "       [ 1, 23, 40],\n",
       "       [13, 68, 61],\n",
       "       [92, 99, 78],\n",
       "       [12, 29, 48],\n",
       "       [35, 10,  9],\n",
       "       [17, 32, 69]])"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score = np.concatenate((a1,a2,a3,a4,a5,a6),axis=0)\n",
    "score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0]])"
      ]
     },
     "execution_count": 120,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#女0 男1\n",
    "random.seed (10)\n",
    "sex=np.random.randint(0,2,size =(300,1))\n",
    "sex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[28, 96, 84,  1],\n",
       "       [57, 11, 85,  0],\n",
       "       [20, 28,  8,  0],\n",
       "       ...,\n",
       "       [12, 29, 48,  1],\n",
       "       [35, 10,  9,  1],\n",
       "       [17, 32, 69,  0]])"
      ]
     },
     "execution_count": 121,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = np.concatenate((score,sex),axis=1)\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>python</th>\n",
       "      <th>数学</th>\n",
       "      <th>语文</th>\n",
       "      <th>sex</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>28</td>\n",
       "      <td>96</td>\n",
       "      <td>84</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>57</td>\n",
       "      <td>11</td>\n",
       "      <td>85</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20</td>\n",
       "      <td>28</td>\n",
       "      <td>8</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>38</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>15</td>\n",
       "      <td>68</td>\n",
       "      <td>67</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1</td>\n",
       "      <td>16</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>24</td>\n",
       "      <td>24</td>\n",
       "      <td>37</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>19</td>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>57</td>\n",
       "      <td>95</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>79</td>\n",
       "      <td>0</td>\n",
       "      <td>53</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>52</td>\n",
       "      <td>63</td>\n",
       "      <td>41</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>34</td>\n",
       "      <td>95</td>\n",
       "      <td>93</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>81</td>\n",
       "      <td>25</td>\n",
       "      <td>37</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>25</td>\n",
       "      <td>95</td>\n",
       "      <td>21</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>87</td>\n",
       "      <td>24</td>\n",
       "      <td>79</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>47</td>\n",
       "      <td>29</td>\n",
       "      <td>23</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>66</td>\n",
       "      <td>33</td>\n",
       "      <td>90</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>51</td>\n",
       "      <td>14</td>\n",
       "      <td>18</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>86</td>\n",
       "      <td>81</td>\n",
       "      <td>49</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>19</td>\n",
       "      <td>80</td>\n",
       "      <td>67</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>3</td>\n",
       "      <td>34</td>\n",
       "      <td>85</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>50</td>\n",
       "      <td>63</td>\n",
       "      <td>39</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>83</td>\n",
       "      <td>29</td>\n",
       "      <td>13</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>87</td>\n",
       "      <td>42</td>\n",
       "      <td>20</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>41</td>\n",
       "      <td>20</td>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>78</td>\n",
       "      <td>62</td>\n",
       "      <td>85</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>25</td>\n",
       "      <td>0</td>\n",
       "      <td>31</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>18</td>\n",
       "      <td>32</td>\n",
       "      <td>63</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>39</td>\n",
       "      <td>91</td>\n",
       "      <td>78</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>9</td>\n",
       "      <td>95</td>\n",
       "      <td>90</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>270</th>\n",
       "      <td>43</td>\n",
       "      <td>10</td>\n",
       "      <td>45</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>271</th>\n",
       "      <td>85</td>\n",
       "      <td>58</td>\n",
       "      <td>21</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>272</th>\n",
       "      <td>42</td>\n",
       "      <td>41</td>\n",
       "      <td>20</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>273</th>\n",
       "      <td>38</td>\n",
       "      <td>50</td>\n",
       "      <td>99</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>274</th>\n",
       "      <td>42</td>\n",
       "      <td>95</td>\n",
       "      <td>16</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>275</th>\n",
       "      <td>51</td>\n",
       "      <td>48</td>\n",
       "      <td>71</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>276</th>\n",
       "      <td>88</td>\n",
       "      <td>52</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>277</th>\n",
       "      <td>85</td>\n",
       "      <td>1</td>\n",
       "      <td>25</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>278</th>\n",
       "      <td>44</td>\n",
       "      <td>14</td>\n",
       "      <td>24</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>279</th>\n",
       "      <td>77</td>\n",
       "      <td>11</td>\n",
       "      <td>59</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>280</th>\n",
       "      <td>11</td>\n",
       "      <td>8</td>\n",
       "      <td>13</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>281</th>\n",
       "      <td>74</td>\n",
       "      <td>70</td>\n",
       "      <td>75</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>282</th>\n",
       "      <td>38</td>\n",
       "      <td>60</td>\n",
       "      <td>64</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>283</th>\n",
       "      <td>41</td>\n",
       "      <td>12</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>284</th>\n",
       "      <td>39</td>\n",
       "      <td>7</td>\n",
       "      <td>35</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>285</th>\n",
       "      <td>1</td>\n",
       "      <td>18</td>\n",
       "      <td>99</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>286</th>\n",
       "      <td>19</td>\n",
       "      <td>38</td>\n",
       "      <td>87</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>287</th>\n",
       "      <td>34</td>\n",
       "      <td>39</td>\n",
       "      <td>32</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>288</th>\n",
       "      <td>89</td>\n",
       "      <td>69</td>\n",
       "      <td>97</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>289</th>\n",
       "      <td>21</td>\n",
       "      <td>41</td>\n",
       "      <td>49</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>290</th>\n",
       "      <td>43</td>\n",
       "      <td>47</td>\n",
       "      <td>77</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>291</th>\n",
       "      <td>52</td>\n",
       "      <td>57</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>292</th>\n",
       "      <td>30</td>\n",
       "      <td>55</td>\n",
       "      <td>58</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>293</th>\n",
       "      <td>61</td>\n",
       "      <td>29</td>\n",
       "      <td>63</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>294</th>\n",
       "      <td>1</td>\n",
       "      <td>23</td>\n",
       "      <td>40</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>295</th>\n",
       "      <td>13</td>\n",
       "      <td>68</td>\n",
       "      <td>61</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>296</th>\n",
       "      <td>92</td>\n",
       "      <td>99</td>\n",
       "      <td>78</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>297</th>\n",
       "      <td>12</td>\n",
       "      <td>29</td>\n",
       "      <td>48</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>298</th>\n",
       "      <td>35</td>\n",
       "      <td>10</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>299</th>\n",
       "      <td>17</td>\n",
       "      <td>32</td>\n",
       "      <td>69</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>300 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     python  数学  语文  sex\n",
       "0        28  96  84    1\n",
       "1        57  11  85    0\n",
       "2        20  28   8    0\n",
       "3         5   5  38    1\n",
       "4        15  68  67    0\n",
       "5         1  16  11    0\n",
       "6        24  24  37    0\n",
       "7        19  78  12    0\n",
       "8        57  95   7    0\n",
       "9        79   0  53    0\n",
       "10       52  63  41    1\n",
       "11       34  95  93    0\n",
       "12       81  25  37    0\n",
       "13       25  95  21    1\n",
       "14       87  24  79    1\n",
       "15       47  29  23    0\n",
       "16       66  33  90    0\n",
       "17       51  14  18    1\n",
       "18       86  81  49    0\n",
       "19       19  80  67    0\n",
       "20        3  34  85    1\n",
       "21       50  63  39    0\n",
       "22       83  29  13    0\n",
       "23       87  42  20    0\n",
       "24       41  20  32    1\n",
       "25       78  62  85    1\n",
       "26       25   0  31    0\n",
       "27       18  32  63    1\n",
       "28       39  91  78    0\n",
       "29        9  95  90    0\n",
       "..      ...  ..  ..  ...\n",
       "270      43  10  45    0\n",
       "271      85  58  21    1\n",
       "272      42  41  20    1\n",
       "273      38  50  99    0\n",
       "274      42  95  16    1\n",
       "275      51  48  71    0\n",
       "276      88  52   3    1\n",
       "277      85   1  25    1\n",
       "278      44  14  24    0\n",
       "279      77  11  59    1\n",
       "280      11   8  13    0\n",
       "281      74  70  75    1\n",
       "282      38  60  64    0\n",
       "283      41  12  11    0\n",
       "284      39   7  35    1\n",
       "285       1  18  99    1\n",
       "286      19  38  87    0\n",
       "287      34  39  32    0\n",
       "288      89  69  97    1\n",
       "289      21  41  49    1\n",
       "290      43  47  77    1\n",
       "291      52  57   4    0\n",
       "292      30  55  58    0\n",
       "293      61  29  63    0\n",
       "294       1  23  40    1\n",
       "295      13  68  61    0\n",
       "296      92  99  78    1\n",
       "297      12  29  48    1\n",
       "298      35  10   9    1\n",
       "299      17  32  69    0\n",
       "\n",
       "[300 rows x 4 columns]"
      ]
     },
     "execution_count": 122,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "columns = ['python','数学','语文','sex']\n",
    "newdata=pd.DataFrame(data,columns=columns)\n",
    "newdata"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 300 entries, 0 to 299\n",
      "Data columns (total 4 columns):\n",
      "python    300 non-null int32\n",
      "数学        300 non-null int32\n",
      "语文        300 non-null int32\n",
      "sex       300 non-null int32\n",
      "dtypes: int32(4)\n",
      "memory usage: 4.8 KB\n"
     ]
    }
   ],
   "source": [
    "newdata.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [],
   "source": [
    "boy=newdata[newdata[('sex')]==1]\n",
    "girl=newdata[newdata[('sex')]==0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>python</th>\n",
       "      <th>数学</th>\n",
       "      <th>语文</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>28</td>\n",
       "      <td>96</td>\n",
       "      <td>84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>38</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>52</td>\n",
       "      <td>63</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>25</td>\n",
       "      <td>95</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>87</td>\n",
       "      <td>24</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>51</td>\n",
       "      <td>14</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>3</td>\n",
       "      <td>34</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>41</td>\n",
       "      <td>20</td>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>78</td>\n",
       "      <td>62</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>18</td>\n",
       "      <td>32</td>\n",
       "      <td>63</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>39</td>\n",
       "      <td>85</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>19</td>\n",
       "      <td>39</td>\n",
       "      <td>86</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>54</td>\n",
       "      <td>88</td>\n",
       "      <td>94</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>95</td>\n",
       "      <td>49</td>\n",
       "      <td>67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36</th>\n",
       "      <td>71</td>\n",
       "      <td>36</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>72</td>\n",
       "      <td>30</td>\n",
       "      <td>84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>96</td>\n",
       "      <td>64</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>26</td>\n",
       "      <td>94</td>\n",
       "      <td>53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>71</td>\n",
       "      <td>53</td>\n",
       "      <td>67</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>91</td>\n",
       "      <td>84</td>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>91</td>\n",
       "      <td>58</td>\n",
       "      <td>93</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>68</td>\n",
       "      <td>5</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>15</td>\n",
       "      <td>16</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>34</td>\n",
       "      <td>98</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54</th>\n",
       "      <td>18</td>\n",
       "      <td>56</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>76</td>\n",
       "      <td>0</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>13</td>\n",
       "      <td>29</td>\n",
       "      <td>79</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>88</td>\n",
       "      <td>96</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>4</td>\n",
       "      <td>77</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>64</td>\n",
       "      <td>43</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>250</th>\n",
       "      <td>51</td>\n",
       "      <td>46</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>251</th>\n",
       "      <td>84</td>\n",
       "      <td>23</td>\n",
       "      <td>77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>253</th>\n",
       "      <td>95</td>\n",
       "      <td>15</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>254</th>\n",
       "      <td>83</td>\n",
       "      <td>90</td>\n",
       "      <td>99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>255</th>\n",
       "      <td>90</td>\n",
       "      <td>12</td>\n",
       "      <td>71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>256</th>\n",
       "      <td>45</td>\n",
       "      <td>35</td>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>257</th>\n",
       "      <td>99</td>\n",
       "      <td>51</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>261</th>\n",
       "      <td>36</td>\n",
       "      <td>87</td>\n",
       "      <td>44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>262</th>\n",
       "      <td>27</td>\n",
       "      <td>77</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>264</th>\n",
       "      <td>69</td>\n",
       "      <td>20</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>265</th>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>266</th>\n",
       "      <td>74</td>\n",
       "      <td>26</td>\n",
       "      <td>34</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>268</th>\n",
       "      <td>41</td>\n",
       "      <td>59</td>\n",
       "      <td>47</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>269</th>\n",
       "      <td>70</td>\n",
       "      <td>0</td>\n",
       "      <td>64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>271</th>\n",
       "      <td>85</td>\n",
       "      <td>58</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>272</th>\n",
       "      <td>42</td>\n",
       "      <td>41</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>274</th>\n",
       "      <td>42</td>\n",
       "      <td>95</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>276</th>\n",
       "      <td>88</td>\n",
       "      <td>52</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>277</th>\n",
       "      <td>85</td>\n",
       "      <td>1</td>\n",
       "      <td>25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>279</th>\n",
       "      <td>77</td>\n",
       "      <td>11</td>\n",
       "      <td>59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>281</th>\n",
       "      <td>74</td>\n",
       "      <td>70</td>\n",
       "      <td>75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>284</th>\n",
       "      <td>39</td>\n",
       "      <td>7</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>285</th>\n",
       "      <td>1</td>\n",
       "      <td>18</td>\n",
       "      <td>99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>288</th>\n",
       "      <td>89</td>\n",
       "      <td>69</td>\n",
       "      <td>97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>289</th>\n",
       "      <td>21</td>\n",
       "      <td>41</td>\n",
       "      <td>49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>290</th>\n",
       "      <td>43</td>\n",
       "      <td>47</td>\n",
       "      <td>77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>294</th>\n",
       "      <td>1</td>\n",
       "      <td>23</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>296</th>\n",
       "      <td>92</td>\n",
       "      <td>99</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>297</th>\n",
       "      <td>12</td>\n",
       "      <td>29</td>\n",
       "      <td>48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>298</th>\n",
       "      <td>35</td>\n",
       "      <td>10</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>138 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     python  数学  语文\n",
       "0        28  96  84\n",
       "3         5   5  38\n",
       "10       52  63  41\n",
       "13       25  95  21\n",
       "14       87  24  79\n",
       "17       51  14  18\n",
       "20        3  34  85\n",
       "24       41  20  32\n",
       "25       78  62  85\n",
       "27       18  32  63\n",
       "30       39  85  68\n",
       "31       19  39  86\n",
       "32       54  88  94\n",
       "33       95  49  67\n",
       "36       71  36   7\n",
       "37       72  30  84\n",
       "38       96  64   4\n",
       "42       26  94  53\n",
       "43       71  53  67\n",
       "45       91  84  32\n",
       "46       91  58  93\n",
       "47       68   5  41\n",
       "52       15  16  15\n",
       "53       34  98  60\n",
       "54       18  56   0\n",
       "55       76   0  17\n",
       "56       13  29  79\n",
       "58       88  96  81\n",
       "59        4  77  22\n",
       "60       64  43  41\n",
       "..      ...  ..  ..\n",
       "250      51  46   5\n",
       "251      84  23  77\n",
       "253      95  15  95\n",
       "254      83  90  99\n",
       "255      90  12  71\n",
       "256      45  35  27\n",
       "257      99  51  19\n",
       "261      36  87  44\n",
       "262      27  77  20\n",
       "264      69  20  74\n",
       "265       1  11   3\n",
       "266      74  26  34\n",
       "268      41  59  47\n",
       "269      70   0  64\n",
       "271      85  58  21\n",
       "272      42  41  20\n",
       "274      42  95  16\n",
       "276      88  52   3\n",
       "277      85   1  25\n",
       "279      77  11  59\n",
       "281      74  70  75\n",
       "284      39   7  35\n",
       "285       1  18  99\n",
       "288      89  69  97\n",
       "289      21  41  49\n",
       "290      43  47  77\n",
       "294       1  23  40\n",
       "296      92  99  78\n",
       "297      12  29  48\n",
       "298      35  10   9\n",
       "\n",
       "[138 rows x 3 columns]"
      ]
     },
     "execution_count": 135,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "boy=boy.drop('sex',axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "metadata": {},
   "outputs": [],
   "source": [
    "girl=girl.drop('sex',axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 141,
   "metadata": {},
   "outputs": [],
   "source": [
    "boys=boy.values\n",
    "girls=girl.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (<ipython-input-129-667c4053b772>, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"<ipython-input-129-667c4053b772>\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m    t[t['sex']=0]\u001b[0m\n\u001b[1;37m              ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "t[t['sex']=0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "男生最小 0\n",
      "男生最大 99\n",
      "男生平均 50.371980676328505\n",
      "男生中位数 50.0\n",
      "男生标准差 29.269475739865637\n"
     ]
    }
   ],
   "source": [
    "print('男生最小值', np.min(boys)) \n",
    "print('男生最大值', np.max(boys)) \n",
    "print('男生平均', np.mean(boys)) \n",
    "print('男生中位数', np.median(boys)) \n",
    "print('男生标准差', np.std(boys)) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "女生最小值 0\n",
      "女生最大值 99\n",
      "女生平均 50.318930041152264\n",
      "女生中位数 51.5\n",
      "女生标准差 29.079484015792566\n"
     ]
    }
   ],
   "source": [
    "print('女生最小值', np.min(girls)) \n",
    "print('女生最大值', np.max(girls)) \n",
    "print('女生平均', np.mean(girls)) \n",
    "print('女生中位数', np.median(girls)) \n",
    "print('女生标准差', np.std(girls)) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
